#include <iostream>
#include "TreeNode.h"

using namespace std;

#define ARRAY_SIZE(ARRAY) (sizeof(ARRAY)/sizeof(ARRAY[0]))
void visitFunc(TreeNode* head)
{
	cout<<head->data<<" ";
}
int main()
{
	TreeNode *head = NULL;
	
	int array[] = {50,25,70,20,30,23,21,90,80,100};
	
	for(int i=0; i<ARRAY_SIZE(array); i++ )
	{
		createTree(head, array[i]);
	}
	
	cout<<"preOrder: " ;
	preOrder(head, &visitFunc);
	cout<<endl;
	
	cout<<"midOrder: ";
	midOrder(head, visitFunc);
	cout<<endl;
	
	cout<<"last Order: ";
	lastOrder(head, visitFunc);
	cout<<endl;
	return 0;
}